package com.ysqcould.revita.service.impl;


import com.ysqcould.common.utils.DateUtils;
import com.ysqcould.revita.domain.HelpAssociation;
import com.ysqcould.revita.mapper.HelpAssociationMapper;
import com.ysqcould.revita.service.IHelpAssociationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 乡村振兴内容Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-30
 */
@Service
public class HelpAssociationServiceImpl implements IHelpAssociationService
{
    @Autowired
    private HelpAssociationMapper helpAssociationMapper;

    /**
     * 查询乡村振兴内容
     * 
     * @param id 乡村振兴内容主键
     * @return 乡村振兴内容
     */
    @Override
    public HelpAssociation selectHelpAssociationById(Long id)
    {
        return helpAssociationMapper.selectHelpAssociationById(id);
    }

    /**
     * 查询乡村振兴内容列表
     * 
     * @param helpAssociation 乡村振兴内容
     * @return 乡村振兴内容
     */
    @Override
    public List<HelpAssociation> selectHelpAssociationList(HelpAssociation helpAssociation)
    {
        return helpAssociationMapper.selectHelpAssociationList(helpAssociation);
    }

    /**
     * 新增乡村振兴内容
     * 
     * @param helpAssociation 乡村振兴内容
     * @return 结果
     */
    @Override
    public int insertHelpAssociation(HelpAssociation helpAssociation)
    {
        helpAssociation.setCreateTime(DateUtils.getNowDate());
        return helpAssociationMapper.insertHelpAssociation(helpAssociation);
    }

    /**
     * 修改乡村振兴内容
     * 
     * @param helpAssociation 乡村振兴内容
     * @return 结果
     */
    @Override
    public int updateHelpAssociation(HelpAssociation helpAssociation)
    {
        helpAssociation.setUpdateTime(DateUtils.getNowDate());
        return helpAssociationMapper.updateHelpAssociation(helpAssociation);
    }

    /**
     * 批量删除乡村振兴内容
     * 
     * @param ids 需要删除的乡村振兴内容主键
     * @return 结果
     */
    @Override
    public int deleteHelpAssociationByIds(Long[] ids)
    {
        return helpAssociationMapper.deleteHelpAssociationByIds(ids);
    }

    /**
     * 删除乡村振兴内容信息
     * 
     * @param id 乡村振兴内容主键
     * @return 结果
     */
    @Override
    public int deleteHelpAssociationById(Long id)
    {
        return helpAssociationMapper.deleteHelpAssociationById(id);
    }
}
